Skip to content

Fix Azure Static Web Apps workflow: Only deploy after merge to main#8

Merged
tsimiz merged 2 commits intomainfrom
copilot/fix-7
Jul 2, 2025
Merged

Fix Azure Static Web Apps workflow: Only deploy after merge to main#8
tsimiz merged 2 commits intomainfrom
copilot/fix-7

Conversation

Copy link
Contributor

Copilot AI commented Jul 2, 2025

The Azure Static Web Apps deployment workflow was triggering on both pull request events and pushes to main, causing premature deployments before copilot agent changes were finalized and merged.

Problem

Previously, the workflow deployed the app in two scenarios:

  1. During PR review - When PRs were opened, synchronized, or reopened (before changes were finalized)
  2. After merge - When code was pushed to main branch

This meant incomplete changes were being deployed during the PR review process, before the copilot agent had completed its work and the changes were properly reviewed and merged.

Solution

Modified the workflow to only deploy when code is pushed to the main branch:

# Before: Triggered on both PR events and push to main
on:
  push:
    branches: [main]
  pull_request:
    types: [opened, synchronize, reopened, closed]
    branches: [main]

# After: Only triggers on push to main
on:
  push:
    branches: [main]

Changes Made

  • ✅ Removed pull_request triggers from workflow events
  • ✅ Removed conditional logic for PR vs push events
  • ✅ Removed close_pull_request_job that handled PR cleanup
  • ✅ Simplified workflow to only run on push to main branch

Result

Deployment to Azure Static Web Apps now only happens after code is merged to the main branch, ensuring that all copilot agent changes are included in the deployed version. The workflow is simpler, more predictable, and prevents deployment of incomplete changes during the PR review process.

Fixes #7.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: tsimiz <60962498+tsimiz@users.noreply.github.com>
Copilot AI changed the title [WIP] Changing the workflow structure Fix Azure Static Web Apps workflow: Only deploy after merge to main Jul 2, 2025
Copilot finished work on behalf of tsimiz July 2, 2025 15:45
Copilot AI requested a review from tsimiz July 2, 2025 15:45
@tsimiz tsimiz marked this pull request as ready for review July 2, 2025 15:58
@tsimiz tsimiz merged commit c25e898 into main Jul 2, 2025
@tsimiz tsimiz deleted the copilot/fix-7 branch July 2, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing the workflow structure

2 participants